Skip to main content

What are document sets, and are they relevant in 2023?

·5 mins

Document sets

Depending on how long you’ve been working with SharePoint you probably either just had a flashback to good old classic document libraries, or you’re sitting here staring into the void thinking document whats?

What are Document sets

Document sets is a fairly old feature that sorta got lost in the process that is the SharePoint classic to Modern UI transformation, and while they technically made a return to modern all the way back in 2019, they still haven’t gotten all the way back to their former glory, often referred to as “the blue folders”, they’re a special folder type.

Of course you’re able to place files inside them as with any other folder, but the first an most obvious difference is the option to tag them with metadata, but with a bit of trickery, you could also do that on a “yellow folder” using quick edit, so why are they so special?

Shared Columns

Now why would I want metadata on a folder, well for one it improves searchability, and this is also where document sets have their first really big advantage, “Shared Columns”, with a document set you have the option to “share” specific columns to EVERY file that’s inside the document library, no matter if the content type of the document has that column or not the value will be set on the files, this is really useful for search.

A classic use-case that you’ll see is a CRM integration, where every opportunity is created as a document set, with a customer column auto populated, this way you can setup a search portal where I can now filter for documents by the customer - making it easy to find what you’re looking for, even across projects!

Default content

With a document set you have the option to set default content, this means you can automatically create a set of files and/or folders every time a new document set is created, you can even add the name of the document set to those files - that means you can configure it so when you create an opportunity there’ll already be a ‘data processing agreement ready’ for the client to sign, making sure there’s no excuse not to get it signed.

Limit content types

Another really neat feature, is the ability to limit content types within a document set, so you could theoretically create a setup where you cannot add a data processing agreement to a “self-hosted client” - this is a feature that takes a bit more setup to get right, but when you get it right - it’s a gamechanger!

Issues

Classic layout

Now it’s not all fun and games, unfortunately whiles’t document sets works in modern UI, Microsoft for some reason still here 3 years after enabling it still haven’t modernized the UI to create them, so users will be redirected to a classic page that looks like … well Classic SharePoint

Even if you like the look of classic SharePoint, this looks dated in 2023

Now recently Microsoft created the option for us to control the new form with SPFx by creating form customizers - but I’ve found some odd behavior whereby when you NULL the new form id for it to use, you’ll actually get a modern experience, why this works, or if it breaks anything else I’ve yet to figure out, so do this at your own risk.

I’ve created a script to do it here

Welcome pages

A feature that never made it to modern UI from classic for some odd reason is the Welcome Pages, they where a way to visually display certain columns, like the description of the document set at the top of the screen when you opened the document set, this meant you could have things like a “project brief” right there, front and center.

Instead it seems Microsoft has opted to force the information pane on the right to always open whenever a user enters the document set, no matter if it was open or closed prior to them clicking it.

This provides some of the same aspects, but in a much less “visual” way then before.

Getting started - disabled site feature

Document sets are a Site Collection feature that you must first enable, and then you can create content types that inherits from them, with the columns that you need, this is a minor thing, but puts the feature out of scope for most newer users, unfortunately.

It would be nice to see Microsoft do more to raise awareness of this awesome feature, but I guess it’s a chicken and the egg kinda situation.

Programmatically

Working with document sets from code is actually pretty straight forward, once you’ve done it a few times, the important part is that it’s a two step process to create them.

First you add a new folder, and then you’ll need to change the Content Type.

Another thing to be aware of is that you need to set two values in order to rename a document set, both the FileLeafRef and Title.

{
    "Title": "New name",
    "FileLeafRef": "New name",
    "ContentTypeId":"0x0120....."
}

If you’re using things like PnP Framework there are built in extension methods to handle this sort of thing right out of the box, so you should be golden there.

TL;DR

Document sets are a great way to introduce more searchability into your documents, and streamline processes of document creation, and metadata maintenance.